package _23pattern.creational.singleton.m4;

//静态内部类
public class SingleObject {
	private static class SingletonHolder {
		private static final SingleObject INSTANCE = new SingleObject();
	}

	private SingleObject() {
	}

	public static final SingleObject getInstance() {
		return SingletonHolder.INSTANCE;
	}
}

class Single {
	private static class SingleHolder {
		private static final Single instance = new Single();
	}

	private Single() {

	}

	public static final Single getInstance() {
		return SingleHolder.instance;
	}
}